package com.itheima.web.job;

import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class LogTask {

    @Reference
    private AnalysisByDayService analysisByDayService;

    /**
     * 定时任务 ,每一小时记录一次日志数据
     */
    @Scheduled(cron = "0 0 0/1 * * *")
    public void run() {
        //System.out.println("开始记录日志");
        analysisByDayService.saveOrUpdate();
    }
}
